Skip to content

fix(core): honor commitment for remote account batches - #762

Open
xternet wants to merge 1 commit into
solana-foundation:mainfrom
xternet:agent/honor-account-commitment
Open

fix(core): honor commitment for remote account batches#762
xternet wants to merge 1 commit into
solana-foundation:mainfrom
xternet:agent/honor-account-commitment

Conversation

@xternet

@xternet xternet commented Aug 13, 2026

Copy link
Copy Markdown

Summary

SurfnetRemoteClient::get_multiple_accounts accepts a caller-selected commitment, but its primary account batch used RpcClient::get_multiple_accounts, which silently applied the client's default commitment. Companion mint/program-account fetches in the same method already used the requested commitment.

Use get_multiple_accounts_with_commitment for the primary batch as well, then extract the contextual response value. This keeps every remote account fetched by the operation at the same requested commitment.

Regression test

The new test records the outgoing JSON-RPC request through a custom RpcSender. It requests confirmed and asserts that the getMultipleAccounts config actually contains "commitment": "confirmed"; before this patch it observed "finalized".

Validation

  • cargo +nightly fmt --all -- --check
  • cargo test -p surfpool-core surfnet::remote::tests -- --test-threads=1 — 3 passed
  • cargo clippy -p surfpool-core --lib --no-default-features — completed with existing repository warnings only
  • git diff --check

I also attempted the complete surfpool-core lib suite locally. It reached 469 passing tests before the shared runner exhausted its open-file limit; the remaining failures reported Too many open files, rather than assertion failures from this change. GitHub CI can run the full suite in its normal environment.

@xternet
xternet marked this pull request as ready for review August 13, 2026 19:37
@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes the primary remote account batch honor the caller-selected commitment, aligning it with companion mint and program-account fetches.

  • Replaces the default-commitment batch RPC call with get_multiple_accounts_with_commitment.
  • Extracts the contextual RPC response value before existing account processing.
  • Adds a custom RPC sender test that verifies confirmed is serialized into the outgoing request.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or maintainability issues identified.

The commitment-aware RPC method preserves the existing account-vector processing while ensuring both primary and dependent remote fetches use the caller-selected commitment, and the new test verifies the serialized request configuration.

Important Files Changed

Filename Overview
crates/core/src/surfnet/remote.rs Correctly propagates the requested commitment through the primary remote-account batch and adds focused request-level regression coverage; no actionable issues identified.

Reviews (1): Last reviewed commit: "fix(core): honor commitment for remote a..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant